package codigo;
import java_cup.runtime.Symbol;


%%
%cup
%line
%column
%char
%eofval{
	return new Symbol(sym.EOF,new String("Fin del archivo"));
%eofval}


digito = [0-9]
espacio = \t|\f|" "|\r|\n


%%

"while"		 {return new Symbol(sym.Mientras, yytext());}
"("			 {return new Symbol(sym.Par_a, yychar, yyline, yytext());}
")"			 {return new Symbol(sym.Par_c, yychar, yyline, yytext());}
"{" 		 {return new Symbol(sym.Llav_a, yychar, yyline, yytext());} 
"}" 		 {return new Symbol(sym.Llav_b, yychar, yyline, yytext());}
">" 		 {return new Symbol(sym.Mayor, yychar, yyline, yytext());}
">=" 		 {return new Symbol(sym.May_igual, yychar, yyline, yytext());}
"<" 		 {return new Symbol(sym.Menor, yychar, yyline, yytext());}
"<=" 		 {return new Symbol(sym.Men_igual, yychar, yyline, yytext());}
"=" 		 {return new Symbol(sym.Igual, yychar, yyline, yytext());}
"&&"		 {return new Symbol(sym.And, yychar, yyline, yytext());}
"||" 		 {return new Symbol(sym.Or, yychar, yyline, yytext());}
"!=" 		 {return new Symbol(sym.Dif, yychar, yyline, yytext());}
"¬" 		 {return new Symbol(sym.Neg, yychar, yyline, yytext());}
{digito}+	 {return new Symbol(sym.NUMBER, yychar, yyline, new Integer(yytext()));}
{espacio} 	 {}
. {System.out.println("error lexico en la fila "+yyline +" y en la columna " + yychar);}


